#pragma region Description
/*
     Copyright © 2011 Jesse 'LorgonJortle' Wilkerson
     See licensing in source (.cpp) file, or at:
     <http://www.gnu.org/licenses/> (GPL)

     File: Vector2.h
     Author: Jesse 'LorgonJortle' Wilkerson
     Description:
          Like Vector3, a Vector2 consists of floating-point
          components and has many methods for linear
          mathematics. The only difference is that Vector2
          is a 2D vector.
*/
#pragma endregion

#ifndef VECTOR2_H
#define VECTOR2_H

/*****************************************
                              OpenGL
*****************************************/
     #ifdef __APPLE__
         #include <glew.h>
     #else
         #include <GL/glew.h>
     #endif
/****************************************/

/*****************************************
                         Standard C++
*****************************************/
     #include <cmath>
     #include <string>
     #include <sstream>
/****************************************/

namespace LOGL_GLib
{
     namespace Math
     {
          GLboolean Equal(GLfloat _A, GLfloat _B);
     }
     using namespace Math;

     namespace Common
     {
          class Vector2
          {
          public:
               /* Constructs a Vector2 with both components set to zero. */
               Vector2();
               /* Constructs a Vector2 with the specified value for X and Y. */
               Vector2(GLfloat _XY);
               /* Constructs a Vector2 with the specified values. */
               Vector2(GLfloat _X, GLfloat _Y);

               /* Determines if the specified vector is equal to this. */
               GLboolean operator==(const Vector2& _Vector) const;
               /* Determines if the specified vector is not equal to this. */
               GLboolean operator!=(const Vector2& _Vector) const;
               /* Assigns the specified vector to this. */
               Vector2& operator=(const Vector2& _Vector);
               /* Assigns the specified value to all components of this. */
               Vector2& operator=(GLfloat _XY);
               /* Computes the negated version of this. */
               Vector2 operator-() const;
               /* Computes the sum of two vectors. */
               Vector2 operator+(const Vector2& _Delta) const;
               /* Adds the specified vector to this. */
               GLvoid operator+=(const Vector2& _Delta);
               /* Computes the difference of two vectors. */
               Vector2 operator-(const Vector2& _Delta) const;
               /* Subtracts the specified vector from this. */
               GLvoid operator-=(const Vector2& _Delta);
               /* Computes the scaled resultant of a vector and scalar. */
               Vector2 operator*(GLfloat _Scale) const;
               /* Scales this by the specified scalar. */
               GLvoid operator*=(GLfloat _Scale);
               /* Computes the resultant of this dived by the specified scalar. */
               Vector2 operator/(GLfloat _Divisor) const;
               /* Divides this by the specified scalar. */
               GLvoid operator/=(GLfloat _Divisor);
               /* Outputs the specifed vector to standard out. */
               friend std::ostream& operator<<(std::ostream& _Stream, const Vector2& _Vector);

               /* Negates all components of this. */
               GLvoid Negate();
               /* Negates all components of the specified vector. */
               static Vector2 Negate(const Vector2& _Vector);
               /* Calculates the length of the vector. */
               GLfloat Length() const;
               /* Calculates the appropriate unit vector. */
               GLvoid Normalize();
               /* Calculates the dot product between this and the specified vector. */
               GLfloat Dot(const Vector2& _B) const;
               /* Calculates the dot product between the two specified vectors. */
               static GLfloat Dot(const Vector2& _A, const Vector2& _B);
               /* Calculates the appropriate unit vector for the specified vector. */
               static Vector2 Normalize(const Vector2& _Vector);
               /* Calculates the angle between this and the specified vector. */
               GLfloat AngleBetween(const Vector2& _B) const;
               /* Calculates the angle between the two specified vectors. */
               static GLfloat AngleBetween(const Vector2& _A, const Vector2& _B);
               /* Calculates the distance this points in the direction of the specified vector. */
               GLfloat Component(const Vector2& _B) const;
               /* Calculates the distance one vector points in the direction of another. */
               static GLfloat Component(const Vector2& _A, const Vector2& _B);
               /* Calculates this projected on the specified vector. */
               Vector2 Project(const Vector2& _B) const;
               /* Calculates one vector projected on another. */
               static Vector2 Project(const Vector2& _A, const Vector2& _B);
               /* Calculates the reflection of this across the specified vector. */
               Vector2 Reflect(const Vector2& _B) const;
               /* Calculates the reflection of one vector across another. */
               static Vector2 Reflect(const Vector2& _A, const Vector2& _B);

               /* Returns a string representation of the Vector2. */
               std::string ToString() const;

               /* The X component of the Vector2. */
               GLfloat X;
               /* The Y component of the Vector2. */
               GLfloat Y;

          }; /* Class Vector2. */
     } /* Namespace Common. */
} /* Namespace LOGL_GLib. */

#endif
